package session;

import java.io.Closeable;
import java.sql.Connection;
import java.util.List;
import java.util.Map;

public interface SqlSession extends Closeable {

    <T> T selectOne(String statement);

    <T> T selectOne(String statement, Object parameter);

    <E> List<E> selectList(String statement);

    <E> List<E> selectList(String statement, Object parameter);

    <E> List<E> selectList(String statement, Object parameter, RowBounds rowBounds);


    void select(String statement, Object parameter, ResultHandler handler);

    void select(String statement, ResultHandler handler);

    void select(String statement, Object parameter, RowBounds rowBounds, ResultHandler handler);

    int insert(String statement);

    int insert(String statement, Object parameter);

    int update(String statement);

    int update(String statement, Object parameter);


    void commit();

    void commit(boolean force);

    void rollback();

    void rollback(boolean force);


    @Override
    void close();


    Configuration getConfiguration();

    <T> T getMapper(Class<T> type);

    Connection getConnection();
}
